{config_load file='site.conf' section='entry_index'}
{include file='header.tpl'}
{literal}
 <SCRIPT LANGUAGE="JavaScript">
 <!--
 	 $(document).ready(function()
	{
		$("#tb_list tr").mouseover(function(){$(this).addClass("over");}).mouseout(function(){$(this).removeClass("over");});
		
	}
	);
					   
	function doDelEntry(entry_id)
	{
		if(confirm("本当にエントリ["+entry_id+"]を削除しますか"))
		{

			$("#actionType").attr("value","del");
			$("#entry_id").attr("value",entry_id);
			$("#myForm").submit();
		}
	}
	
	function doEditEntry(entry_id)
	{
		$("#action").attr("value","view");
		$("#entry_id").attr("value",entry_id);
		$("#myForm").attr("method","post");
		$("#myForm").attr("action","entry_edit.php");
		$("#myForm").submit();
	}
 //-->
 </SCRIPT>
{/literal}
<div id="bg">
	<div id="page">
		<div id="content">
		{if $msg ne ""}<div class="errorMsg">{$msg}</div>{/if}
			<div class="post">
				<h2 class="title">エントリ検索</h2>
				<div class="entry">
								
				<form id="myForm" action="{$SCRIPT_NAME}" method="get">
				<input type="hidden" name="actionType" id="actionType"/>
				<input type="hidden" name="entry_id" id="entry_id"/>
				<table width="500" id="tb_form">
                	<tr>
                        <th >エントリタイトル：</th>
                        <td><input name="title" type="text" id="title" size="30" maxlength="30" value="{$formvars.title|escape}" /></td>
                    </tr>
                    <tr>
						<th >&nbsp</th>
                        <td><input type="submit" value="検索" class="submitButton"/></td>
                    </tr>
	        	</table>
					
				</form>
				</div>
			</div>	
			<div class="post">	
			<h2 class="title">エントリ一覧</h2>
				<div class="entry">
				{$paging}
				<form id="delForm" action="{$SCRIPT_NAME}" method="post">
				<input type="hidden" name="actionType" id="actionType" value="deleteVideo"/>
				<input type="hidden" name="page" id="page" value="{$formvars.page|escape}"/>
                <table width="850" border="0" cellpadding="8" cellspacing="1" id="tb_list" >
                  <tr bgcolor="#CC0000">
                    <th>エントリID</th>
                    <th>タイトル</th>
                    <th>投稿日時</th>
                    <th>関連動画数</th>
					<th>ステータス</th>
                    <th>&nbsp;</th>
                  </tr>
				  
				  {foreach from=$entryList item=row}
    				<tr class="{cycle values="alt,"}">
	                	<td>{ $row.entry_id }</td>
    					<td>
						{ $row.title } <a href="{ $row.entry_url }" target="_blank">GO</a>
						{if $row.videoNum > 0 }
						<table class="tb_clean">
						{foreach from=$row.videoList key=k item=video}
							<tr>
							<td style="border-width:0px">
							<INPUT type="checkbox" name="checkVideoId[]" value="{$video.video_id}">
							</td>
							<td style="border-width:0px">{if $video.flash_obj != ''}{$video.flash_obj}
								{elseif $video.url != ''}<a href="{$video.url}" target="_blank">動画リンク</a>
								{else}不正動画{/if}</td>
							</tr>
						{/foreach}
						</table>
						{/if}

						</td>
    					<td>{ $row.up_date } </td>
    					<td>{ $row.videoNum }</td>
						<td>{if $row.open_flag == 1}open{else}close{/if}</td>
    					<td><a href="#" OnClick="doEditEntry({$row.entry_id});">編集</a> <a href="#" OnClick="doDelEntry({$row.entry_id});">削除</a></td>
                 	 </tr>
				  {/foreach}
                </table>
				{$paging}
				<br /><input type="submit" value="動画削除" class="submitButton"/>
				</form>
			  </div>
			</div>
		</div>
		<!-- end #content -->
		<!-- end #sidebar -->
<div style="clear: both; height: 20px;">&nbsp;</div>
	</div>
	<!-- end #page -->
</div>
{include file='footer.tpl'}



